<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>学知鸟</title>
		<link rel="shortcut icon" href="../../share/img/logo.png">
		<link rel="stylesheet" href="../../share/css/main.css">
		<script src="../../share/js/jquery-1.11.3.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../share/js/log.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div class="row">
			<div class="col-1">
				<section>
					<h3>setTimeOut</h3>
					<button onclick="doTest(test01)">循环内setTimeOut</button>
				</section>
			</div>
			<div class="col-1">
				<pre id="code">
					
				</pre>
			</div>
			<div class="col-1">
				<ul id="log" class="plist"></ul>
			</div>
		</div>

		<script>
			function doTest(fn){
				showCode(fn);
				fn();
			}
			function test01() {
				ULog.reset("循环内setTimeOut");
				for (var i = 0; i < 10; i++) {
					setTimeout(() => {
						ULog.append("i = " + i);
					}, i * 100);
				}
			}
			
			function showCode(fn){
				$("#code").text(fn.toString());
			}
		</script>
	</body>
</html>
